 # -*- coding: utf-8 -*-
 
 
<h1 class='title'>Books<em>book</em><h1>
 import urllib2
 from lxml import etree
 from lxml import html 
 url="http://www.zuoye.com"  
 requset=urllib2.Request(url)  #请求URL
 response=urllib2.urlopen(request)  #打开URL
 html=response.read()        
 selector=etree.HTML(html)  #获取DOM树所有节点
 
 blog=selector.xpath("//h1[@class='title']/text()").extract()  #得到h1[@class='title']下的文本
 
 
 
 